<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <!-- BEGIN META -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="Olive Enterprise">
    <!-- END META -->
    <title>员工自助修改信息审核页面</title>
    <link href="/Public/User/update/css/layui/src/css/layui.css" rel="stylesheet">
    <link rel="shortcut icon" type="image/x-icon"  href="/Public/User/update/img/ooopic_1497861131.ico">
    <!-- BEGIN STYLESHEET-->
    <link href="/Public/User/update/css/bootstrap3.3.4.css" rel="stylesheet">
    <link href="/Public/User/update/css/bootstrap-reset.css" rel="stylesheet">
    <link href="/Public/User/update/css/style.css" rel="stylesheet">
    <link href="/Public/User/update/css/style-responsive.css" rel="stylesheet">
    <link href="/Public/User/update/assets/morris.js-0.4.3/morris.css" rel="stylesheet">
    <link href="/Public/User/css/mystyle.css" rel="stylesheet">

    <script src="/Public/User/update/js/jquery.js" ></script>
    <script src="/Public/User/update/css/layer/layer/layer.js" ></script>
    <link href="/Public/User/update/css/clndr.css" rel="stylesheet">
    <!--[if lt IE 9]>
    <script src="/Public/User/update/js/html5shiv.js">
    </script>
    <script src="/Public/User/update/js/respond.min.js">
    </script>
    <![endif]-->
    <style>
        body{
            font-family: '微软雅黑';
            background: #fff;
        }
        .table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td{
            /*line-height: 2.4285;*/
            line-height: 1.0 !important;
        }
        /**郑春阳*/
        .control-label{
            width: 25%;
            font-size:12px !important;
            font-weight: normal !important;
            color: rgb(51,51,51);
            margin-top: 3px;
        }
        .sp_result,.change_content{
            font-size:12px !important;
            font-weight: normal !important;
            color: rgb(51,51,51);
            text-align: center;
        }
        .adv-table table tr td{
          padding: 4px;
        }
        .form-control[readonly],input[readonly]{
            margin: 0;
            background: #fff !important;
            height:27px !important;
            /*border: 1px solid #ccc;*/
            border-radius:1px;
            padding: 4px;
            color:#333333;
            /*line-height: 31px;*/
            font-size: 12px;
            text-align: center;
            border: none;
        }
        .layer_input input{
            border: 1px solid #ccc !important;
        }
        .zd_table,.gradeX{
            color: rgb(51,51,51);
        }
        .gradeX{
            font-size: 12px;
        }
        /*文件上传列表*/
        .layui-layer-molv .layui-layer-title{
            color:#5B636B;
            background: #fff;
            padding: 0;
            text-align: center;
        }
        .layui-layer-btn{
            text-align: center;
        }
        .layui-layer-dialog .layui-layer-content{
            padding-top: 0;
            padding-bottom: 0;
        }
        .layui-layer-molv .layui-layer-btn a{
            background: #3383da;
        }
        .file_handle>span{
            margin-left: 20px;
            font-size:14px;
        }
        .file_area tr>td:nth-child(1){
            width: 60%;
            font-size:14px;
        }
        /*修改结束*/
        .col-sm-3{
            padding-left: 0px;
        }
        .col-sm-9{
            padding-left: 0px;
        }
        .menu_box ul li ul.sub_menu li {
            padding-left: 0;
        }
        .menu_box ul li ul.sub_menu li a {
            padding: 0;
            font-family:Microsoft YaHei, Tahoma, Helvetica, Arial, "\5b8b\4f53", sans-serif !important;
            font-size: 12px !important;
        }
        .menu_box ul li h3{
            font-size: 15px;
            font-weight: bold;
        }
        .top_left{
            width: 100%;
            position: relative;
        }
        .top_left div{
            text-align: center;
        }
        .back_btn{
            position: absolute;
            top:0;
            right: 80px;
        }
        .but{
            height:30px;
            font-size:12px !important;
            padding: 6px 12px;
            margin-bottom: 8px;
            font-weight: 400;
            line-height: 1.42857143;
            text-align: center;
            white-space: nowrap;
            vertical-align: middle;
        }
        .btn-info{
            color: rgb(255, 255, 255);
            background-color:  #3383da;
            border:1px solid  #3383da;;
        }
        .top_box{
            border-bottom: 1px solid #d5d5d5;
            box-shadow: 0px 2px 1px #efefef;
            background: white;
            box-sizing: border-box;
            position: relative;
            clear: both;
            line-height: 40px;
            height: 40px;
            /*background-color: #0097B4; ;*/
            /*background: #bae3f9;*/
        }
        .display{
            margin: 0 auto;
        }

        /*字体大小修改*/
        th,th div{
            font-size: 14px;
        }
        .filebtn{
            width:71px;
            background-color: #ccc;
            border: 1px solid #ccc;
            padding: 6px 12px;
            color: rgb(51,51,51);
            display: block;
            margin: 0 auto;
        }
        /*隐藏滚动条*/
        body::-webkit-scrollbar{width:0;}
    </style>
</head>
<body>
<!-- BEGIN PANEL SECTION -->
<div class="top_box">
    <div class="top_left">
        <div><h4>个人信息修改记录</h4></div>
        <div class="back_btn">
            <ul>
                <li>
                    <button class="but btn-info" style="width:70px;margin-left:50px;color:white;font-size:18px" id="fh"  >返回</button>
                </li>
            </ul>
        </div>
    </div>
</div>
<section class="panel">
    <div >
        <div class="adv-table">
            <table  class="display table table-bordered" >
                <!-------------------------员工入司基本信息开始--------------------------->
                <?php if($base_info){ ?>
                <tr>
                    <table class="display table table-bordered" >
                        <tr>
                            <th class="col-sm-6 col-sm-6 label-primary" style="width:16%; background: #669acc; text-align: center; color: #fff; padding: 2px;" >
                                <h4 style="font-size:16px;margin:5px;">字段名</h4>
                            </th>
                            <th class="col-sm-6 col-sm-6 label-primary" style="width:42%; background: #669acc; text-align: center; color: #fff; padding: 2px;" >
                                <h4 style="font-size:16px;margin:5px;">员工基本信息(更改前)</h4>
                            </th>
                            <th class="col-sm-6 col-sm-6 label-primary" style="width:42%; background: #669acc; text-align: center; color: #fff; padding: 2px;" >
                                <h4 style="font-size:16px;margin:5px;">员工基本信息(更改后)</h4>
                            </th>
                        </tr>
                        <?php foreach($base_info['sublist'] as $k=>$v){ if($v['type']=='FILE'){ ?>
                        <tr>
                            <td class="col-sm-3 col-sm-3 control-label">
                                <div class="form-group">
                                    <label class="col-sm-6 col-sm-6 control-label" style="cursor:pointer" title="<?php echo $v['caption'];?>"><?php echo mb_substr($v['caption'],0,8,'utf-8');?></label>
                                    <div class="col-sm-6">
                                        <button class="filebtn get_base_info"  menu="BO_CASC_HR_YGRS" zd_name="<?php echo ($k); ?>" val="<?php echo $v['value'];?>" type="edit" >查看</button>
                                    </div>
                                </div>
                            </td>
                            <td class="col-sm-3 col-sm-3 control-label">
                                <div class="form-group">
                                    <label class="col-sm-6 col-sm-6 control-label" style="cursor:pointer" title="<?php echo $v['caption'];?>"><?php echo mb_substr($v['caption'],0,8,'utf-8');?></label>
                                    <div class="col-sm-6">
                                        <button class="filebtn get_base_info"  menu="BO_CASC_HR_YGRS" zd_name="<?php echo ($k); ?>" val="<?php echo $v['value'];?>" type="former" >查看</button>
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <?php }else{ ?>
                        <tr>
                            <td class="col-sm-3 col-sm-3 control-label" style="width:16%;">
                                <div class="form-group">
                                    <label class="col-sm-12 col-sm-12 change_content" style="cursor:pointer" title="<?php echo $v['caption'];?>"><?php echo mb_substr($v['caption'],0,8,'utf-8');?></label>
                                </div>
                            </td>
                            <td class="col-sm-3 col-sm-3 control-label" style="width:42%;">
                                <div class="form-group">
                                    <div class="col-sm-12">
                                        <span class="form-control" style="cursor:pointer" title="<?php echo $v['value'];?>"readonly><?php echo $v['value'];?></span>
                                    </div>
                                </div>
                            </td>
                            <td class="col-sm-3 col-sm-3 control-label" style="width:42%;">
                                <div class="form-group">
                                    <div class="col-sm-12">
                                        <span class="form-control" style="cursor:pointer" title="<?php echo $v['oldvalue'];?>" readonly><?php echo $v['oldvalue'];?></span>
                                    </div>
                                </div>
                            </td>

                        </tr>
                        <?php }} ?>
                    </table>
                </tr>
                <?php } ?>
                <!-------------------------员工入司基本信息结束--------------------------->
            </table>

            <!-------------------------扩展子集开始---------------------------------->
            <?php foreach($zj_info as $k=>$v){ $val = $v['value']; $keys = array_keys($val); ?>
            <div style="overflow: auto;" class="col">
                <table  class="table table-bordered" >
                    <tr>
                        <td style="background: #669acc; color: #fff; padding: 2px; " >
                            <h4 title="zijibaioji" style="float:left;font-size: 16px;margin:5px;" ><?php echo $v['caption'];?></h4>
                        </td>
                    </tr>
                    <!---------------------字段名------------------------->
                    <tr class="zd_table">
                        <th><div style="width: 30px; text-align:center;"></div>序号</th>
                        <th><div style="width: 30px; text-align:center;"></div>类型</th>
                        <?php foreach($val[$keys[0]]['info'] as $h=>$j){ ?>
                        <th><div style="cursor:pointer;text-align: center;" title="<?php echo $j['caption'];?>"><?php echo mb_substr($j['caption'],0,9,'utf-8');?></div></th>
                        <?php } ?>
                    </tr>
                    <!---------------------数据--------------------------->
                    <?php $xuhao = 0; foreach($val as $f=>$g){ $xuhao++; if($g['type']=='insert'){ $type_name = '新增'; }elseif($g['type']=='update'){ $type_name = '更改'; }else{ $type_name = '删除'; } ?>
                    <tr class="gradeX">
                        <td style="text-align: center;"><span style="line-height:27px;"><?php echo $xuhao; ?></span></td>
                        <td style="text-align: center;"><span style="line-height:27px;"><?php echo $type_name;?></span></td>
                        <?php foreach($g['info'] as $a=>$b){ if($b['change_type']==1 && $g['type']=='update'){ $style = 'style="color:red;cursor:pointer"'; $class = 'class="up"'; }else{ $style = 'cursor:pointer'; $class = ''; } ?>
                        <td>
                            <?php if($b['type']=='FILE'){ if($b['change_type']==1 && $g['type']=='update'){ $style = 'style="color:red;"'; }else{ $style = ''; } ?>
                                <button class="filebtn get_zj_file" type="<?php echo $g['type'];?>" val="<?php echo $b['value'];?>" <?php echo $style; ?> >查看</button>
                            <?php }else{ ?>
                                <input type="text" <?php echo $style; echo $class; ?> title="<?php echo $b['value'];?>" zd_name="<?php echo $b['caption']; ?>" oldval="<?php echo $b['oldvalue'];?>" value="<?php echo $b['value'];?>" readonly>
                            <?php } ?>
                        </td>
                        <?php } ?>
                    </tr>

                    <tr >
                    </tr>
                    <?php } ?>
                </table>
            </div>
            <?php } ?>
            <!-------------------------扩展子集结束---------------------------------->
        </div>
    </div>
</section>
</body>
<script>
    $(function(){
        var col = $('.col').find('table').find('tr:eq(1)').find('th');
        $('.col').find('table').find('tr:eq(0)').find('td:eq(0)').attr('colspan',col.length);
        $('.col').find('table').find('tr:last').find('td:eq(0)').attr('colspan',col.length);

        $('.shows').parents('table').find('tr:gt(0)').hide();


        /****************************查看修改之前的数据***************************/
        $('.up').click(function(){
            var zd_name = $(this).attr('zd_name');
            var oldval = $(this).attr('oldval');
            var val = $(this).val();
            layer.open({
                type: 1,
                title: false, //不显示标题栏
                closeBtn: false,
                area: '400px;',
                shade: 0.8,
                id: 'LAY_layuipro', //设定一个id，防止重复弹出
                btn: ['确定'],
                moveType: 1 ,//拖拽模式，0或者1
                content: '<div style="padding: 50px;line-height:22px;color:black;" class="layer_input"><div style="text-align:center;font-size:18px;"><span>'+zd_name+'</span></div><br><div class="form-group"><label class="col-sm-3 col-sm-3 control-label">修改后</label><div class="col-sm-9"><input style="color:black;cursor:pointer" title="'+val+'" class="form-control" value="'+val+'" type="text" readonly></div></div><br><div class="form-group"><label class="col-sm-3 col-sm-3 control-label" >修改前</label><div class="col-sm-9"><input class="form-control" style="color:black;cursor:pointer" title="'+oldval+'" type="text" value="'+oldval+'" readonly></div></div>',
                success: function(layero){
                    var btn = layero.find('.layui-layer-btn');
                    btn.css('text-align', 'center');

                }
            });

        })
        $('#fh').click(function(){
            var uuid = '<?php echo ($uuid); ?>';
            var token = '<?php echo ($token); ?>';

            location.href = '/Pc/Pc/index/id/'+uuid+'/token/'+token;

        })
    })
    $('.get_base_info').click(function(){
        var type = $(this).attr('type');
        var val = $(this).attr('val');
        if(val){
            val = val.split('--');
            //var html = '<table class="table table-hover file_area"><tr><td>2.pdf</td><td class="file_handle"><span>新增</span><span><a href="">下载</a></span></td></tr></table>';
            var html = '<table class="table table-hover file_area">';
            for(var i=0;i<val.length;i++){
                var _v = val[i].split('@@');
                if(type == 'former'){
                    if(_v[2] != 2 ){
                        html += '<tr><td>'+_v[0]+'</td><td class="file_handle"><span><a href="'+_v[1]+'">下载</a></span></td></tr>';
                    }
                }else{
                    if(_v[2] ==1){
                        var zt = '原有';
                    }else if(_v[2] == 2){
                        var zt = '新增';
                    }else if(_v[2] == 3){
                        var zt = '修改';
                    }else if(_v[2] == 4){
                        var zt = '删除';
                    }
                    html += '<tr><td>'+_v[0]+'</td><td class="file_handle"><span>'+zt+'</span>　<span><a href="'+_v[1]+'">下载</a></span></td></tr>'
                }
            }
            html += '</table>';
            layer.alert(html, {
                title:'查看附件',
                area: '550px',
                skin: 'layui-layer-molv' //样式类名
                ,closeBtn: 0
            });
        }else{
            layer.msg('无附件信息');
        }
    });

    $('.get_zj_file').click(function(){
        var val = $(this).attr('val');
        var type = $(this).attr('type');
        if(val){
            val = val.split('--');
            var html = '<table class="table table-hover file_area">';
            for(var i=0;i<val.length;i++){
                var _v = val[i].split('@@');
                if(type == 'delete'){
                    if(_v[2] != 2){
                        html += '<tr><td>'+_v[0]+'</td><td class="file_handle"><span><a href="'+_v[1]+'">下载</a></span></td></tr>';
                    }
                }else{
                    if(_v[2] ==1){
                        var zt = '原有';
                    }else if(_v[2] == 2){
                        var zt = '新增';
                    }else if(_v[2] == 3){
                        var zt = '修改';
                    }else if(_v[2] == 4){
                        var zt = '删除';
                    }
                    html += '<tr><td>'+_v[0]+'</td><td class="file_handle"><span>'+zt+'</span>　<span><a href="'+_v[1]+'">下载</a></span></td></tr>';
                }

            }
            html += '</table>';
            layer.alert(html, {
                title:'查看附件',
                area: '550px',
                skin: 'layui-layer-molv' //样式类名
                ,closeBtn: 0
            });
        }else{
            layer.msg('无附件信息');
        }


    })
</script>
</html>